package com.itheima.thread.synchronizedsafety;

public class AccountThread implements Runnable{
    public Account account;

    public AccountThread(Account account){
        this.account = account;
    }


    public void run(){
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        this.account.withdraw(5000);

        System.out.println(this.account.getcardId()+"取款5000元"+"余额为："+this.account.getBalance());

    }

}
